package org.example.struct.array2;

/**
 * @author liyishan
 * @date 2024/9/14 09:41
 * @apiNote
 */

public class Test02390RemoveStars {
    public String removeStars(String s) {
        StringBuilder sb = new StringBuilder();
        for (char ch : s.toCharArray()) {
            if (ch != '*') {
                sb.append(ch);
            }else{
                sb.deleteCharAt(sb.length() - 1);
            }
        }
        return sb.toString();
    }
}
